package com.tang.framework.lock;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface ShardLock {

    /**
     * 锁key
     *
     * @return
     */
    String value();

    Type type() default Type.TENANT;




    /**
     * 表达式
     * @return
     */
    String[] expressions() default "";

    /**
     * 默认事务
     * @return
     */
    boolean defTransaction() default true;

    /**
     * 事务传播
     * @see org.springframework.transaction.support.TransactionDefinition
     * @return
     */

    int propagationBehavior() default 4;
    /**
     * 事务隔离
     * @see org.springframework.transaction.support.TransactionDefinition
     * @return
     */

    int isolationLevel() default -1;
    enum Type {
        TENANT,

        EXPRESSION;

    }
}
